<div id="HGS_CONSIGNEE">

<script type="text/javascript">
	region.isAdmin = false;
	<?php $_from = $this->_var['lang']['flow_js']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'item');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['item']):
?>
		var <?php echo $this->_var['key']; ?> = "<?php echo $this->_var['item']; ?>";
	<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
	
		onload = function() {
			(!document.all)
			{
				document.forms['theForm'].reset();
			}
		}
	
	var mobile_confirm = "<?php echo $this->_var['mobile_confirm']; ?>";
</script>

	<blockquote style="display:none">
    	FLAG:  <p>
        step				<input type="text" value="<?php echo $this->_var['opration_step']; ?>" /> <p>
    	use cookie 			<input type="text" value="<?php echo $this->_var['temp_user_address']['use_cookie']; ?>" /> <p>
        selected address 	<input type="text" value="<?php echo $this->_var['default_addr']; ?>" id="selected_address" name="selected_address"/> <p>
        local address 		<input type="text" value="<?php echo $this->_var['local_address']; ?>" id="local_address" name="local_address"/>
	</blockquote>


  

<?php $this->assign('display_input','none'); ?>
<?php if ($this->_var['opration_step'] == 'checkout_reg'): ?> <?php $this->assign('display_input','block'); ?> <?php endif; ?>
<?php if ($this->_var['opration_step'] == 'checkout_visit'): ?> <?php $this->assign('display_input','block'); ?> <?php endif; ?>
<?php if ($this->_var['opration_step'] == 'save_reg'): ?> <?php $this->assign('display_input','none'); ?> <?php endif; ?>
<?php if ($this->_var['opration_step'] == 'save_visit'): ?> <?php $this->assign('display_input','none'); ?> <?php endif; ?>
    <div class="peisong_title_name">
        <span class="fold-btn explode-btn" name="peisongdizhi_name_1s">配送地址</span>
       	<span class="xiugai_zhifuxinxi addressTab ctl-btn" id="btn_modify_address">修改</span>

    </div> 
<div class="peisongdizhi" id="peisongdizhi_input" style="display:<?php echo $this->_var['display_input']; ?>">

    <?php $_from = $this->_var['consignee_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'consignee_item');if (count($_from)):
    foreach ($_from AS $this->_var['consignee_item']):
?> 
    <div class="peisong_xiugai_address" id="registered_user_address" >
            <span><input type="radio" name="consignee_list"  class="user-address-list"  value="<?php echo $this->_var['consignee_item']['address_id']; ?>" 
            <?php if ($this->_var['consignee_item']['address_id'] == $this->_var['default_addr']): ?>checked="checked"<?php endif; ?> />
            </span>

            <span style="padding:0px 8px;"><?php echo $this->_var['consignee_item']['consignee']; ?></span>
            <span style="padding:0px 8px;"><?php echo $this->_var['consignee_item']['faddress']; ?></span>
            <span style="padding:0px 8px;"><?php echo $this->_var['consignee_item']['mobile']; ?></span>
            <!--<span style="padding:0px 8px;"><a href="javascript:;">修改</a></span> -->
            <span style="padding:0px 8px;"><a href="javascript:delete_consignee(<?php echo $this->_var['consignee_item']['address_id']; ?>);">删除</a></span>
            <input type="hidden"  id="address_<?php echo $this->_var['consignee_item']['address_id']; ?>" value="<?php echo $this->_var['consignee_item']['consignee']; ?>    <?php echo $this->_var['consignee_item']['faddress']; ?>    <?php echo $this->_var['consignee_item']['mobile']; ?>" />
    </div>
    <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
    
  	<?php $this->assign('display','none'); ?>
    <?php if ($this->_var['temp_user_address']['use_cookie'] == '1'): ?> <?php $this->assign('display','block'); ?> <?php endif; ?>
    <div class="peisong_xiugai_address" id="temp_user_address" style="display:<?php echo $this->_var['display']; ?>">

           <?php $this->assign('check_current',''); ?>
           <?php if ($this->_var['temp_user_address']['use_cookie'] == '1'): ?> <?php $this->assign('check_current','checked'); ?> <?php endif; ?>
			<span>
            	<input type="radio"  name="consignee_list"id="radio_current_address" <?php echo $this->_var['check_current']; ?> <?php if ($this->_var['temp_user_address']['address_value'] == ''): ?> value="1" 
				<?php else: ?> value="<?php echo $this->_var['temp_user_address']['address_value']; ?>" <?php endif; ?> onClick="change_consignee_address()"/>
            </span>
            <input type="hidden" name="consignee_txt" id="radio_current_address_txt" value="<?php echo $this->_var['temp_user_address']['address_value']; ?>"/>
            <span style="padding:0px 16px;" id="temp_user_address_consignee"> <?php echo $this->_var['temp_user_address']['consignee']; ?></span>
            <span style="padding:0px 8px;" id="temp_user_address_full_addr"> <?php echo $this->_var['temp_user_address']['full_address']; ?></span>            		
            <span style="padding:0px 8px;" id="temp_user_address_mobile"> <?php echo $this->_var['temp_user_address']['mobile']; ?></span>
            <!-- <span style="padding:0px 8px;"><a href="javascript:;">修改</a></span> -->
            <span style="padding:0px 8px;"><a href="javascript:delete_consignee_in_cookie();">删除</a></span>
    </div>   
    
    
    <div class="peisong_xiugai_address" id="peisong_update_option">
       <span>
       <?php $this->assign('check',''); ?>
       <?php if ($this->_var['temp_user_address']['use_cookie'] != '1'): ?> <?php $this->assign('check','checked'); ?> <?php endif; ?>
       <?php if ($this->_var['default_addr'] != ''): ?> <?php $this->assign('check',''); ?> <?php endif; ?>       	
       		<input type="radio" name="consignee_list"  id="radio_new_address" <?php echo $this->_var['check']; ?> value="0"  onClick="change_consignee_address()"/> 
       </span>
       <span>使用新地址</span>  
    </div>
    
        
    <?php $this->assign('show_div_new_addr','block'); ?>
    <?php if ($this->_var['default_addr'] != ''): ?> <?php $this->assign('show_div_new_addr','none'); ?> <?php endif; ?> 
    <?php if ($this->_var['temp_user_address']['use_cookie'] == '1'): ?> <?php $this->assign('show_div_new_addr','none'); ?> <?php endif; ?>       	
    <div class="peisong_update_address" id="peisong_update_address" style="display:<?php echo $this->_var['show_div_new_addr']; ?>"> 
         <div class="users_bianji_inputs" style="margin-top:25px; display:inline;">
            <div class="users_bianji_inputs_left">收货人姓名</div>
            <div class="users_bianji_inputs_right">
                <input type="text" id="consignee" name="consignee" value="" maxlength="20" />
            </div>
         </div>
         <div class="users_bianji_inputs" style="margin-top:15px; display:inline;">
            <div class="users_bianji_inputs_left">省市区</div>
            
            <div class="users_bianji_inputs_right">
                    <?php $this->assign('select','selected'); ?>
                    <select name="province" id="selProvinces" onchange="region.changed(this, 2, 'selCities')">
                            <?php $_from = $this->_var['plist']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'province');if (count($_from)):
    foreach ($_from AS $this->_var['province']):
?>
                                <option value="<?php echo $this->_var['province']['region_id']; ?>"><?php echo $this->_var['province']['region_name']; ?></option>
                            <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
                    </select>
                    <select name="city" id="selCities" onchange="region.changed(this, 3, 'selDisctricts')">
                            <?php $_from = $this->_var['clist']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'city');if (count($_from)):
    foreach ($_from AS $this->_var['city']):
?>
                                <option value="<?php echo $this->_var['city']['region_id']; ?>"><?php echo $this->_var['city']['region_name']; ?></option>
                            <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
                    </select>
                    <select name="district" id="selDisctricts" >
                            <?php $_from = $this->_var['dlist']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'district');if (count($_from)):
    foreach ($_from AS $this->_var['district']):
?>
                                <option value="<?php echo $this->_var['district']['region_id']; ?>"><?php echo $this->_var['district']['region_name']; ?></option>
                            <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
                    </select>
            </div>
         </div>  
         <div class="users_bianji_inputs" style="margin-top:15px; display:inline;">
            <div class="users_bianji_inputs_left">详细地址</div>
            <div class="users_bianji_inputs_right">
                <input type="text" name="address" id="ship_info_address" maxlength="50"/>
            </div>
         </div> 
         <div class="users_bianji_inputs" style="margin-top:15px; display:inline;">
            <div class="users_bianji_inputs_left">手机号码</div>
            <div class="users_bianji_inputs_right">
                <input type="text" name="mobile" id="ship_info_telephone" maxlength="11"/>
            </div>
         </div>
         
         <div class="zhifu_update_address_btn"><a href="javascript:;" onclick="save_consignee();"><img src="themes/default/images/zhifu_btns.jpg" /></a></div>
     </div> 


        <div class="set-address-btn" <?php if ($this->_var['consignee_list'] && $_SESSION['user_id'] > 0): ?>style="display:block"<?php elseif ($this->_var['temp_user_address']['use_cookie'] == '1' && $_SESSION['user_id'] == 0): ?><?php else: ?>style="display:none"<?php endif; ?>>
            <a href="javascript:;" onClick="javascript:setAddress();"><img src="themes/default/images/shippingthis.jpg" /></a>
        </div>        
     	<input type="hidden" name="act" value="act_edit_address" />


</div>


<?php $this->assign('display_abstract','none'); ?>
<?php if ($this->_var['temp_user_address']['use_cookie'] == '1'): ?> <?php $this->assign('display_abstract','block'); ?> <?php endif; ?>

<?php $this->assign('display_input','block'); ?>
<?php if ($this->_var['opration_step'] == 'checkout_reg'): ?> <?php $this->assign('display_abstract','none'); ?> <?php endif; ?>
<?php if ($this->_var['opration_step'] == 'checkout_visit'): ?> <?php $this->assign('display_abstract','none'); ?> <?php endif; ?>
<?php if ($this->_var['opration_step'] == 'save_reg'): ?> <?php $this->assign('display_abstract','block'); ?> <?php endif; ?>
<?php if ($this->_var['opration_step'] == 'save_visit'): ?> <?php $this->assign('display_abstract','block'); ?> <?php endif; ?>
<div class="peisongdizhi_name" id="peisongdizhi_abstract" style="display:<?php echo $this->_var['display_abstract']; ?>;"><?php echo $this->_var['address_abstract']; ?></div>

     

</div>